{include file="common:header"}
<body>
<div id="elufenfang-login">
    <div class="login-bg">
        <img src="/static/images/login-bg.jpg">
        <img src="/static/images/login-mbg.jpg" class="m-bg">
    </div>
    <div class="login">
            <form  onsubmit="return false;">
                <div class="login-info login-text">
                    <label>姓名<span>*</span></label>
                    <input type="text" class="user_name" name="user_name" placeholder="请输入姓名">
                </div>
                <div class="login-info login-text">
                    <label>医院<span>*</span></label>
                    <p id="hos-desc"></p>
                    <input type="text" class="doc_hospital" name="doc_hospital" placeholder="请输入医院" id="hos-name">
                </div>
                <div class="login-info login-text">
                    <label>手机号<span>*</span></label>
                    <input type="text" class="mobile" name="mobile" placeholder="请输入手机号">
                </div>
                <div class="login-info login-submit">
                    <button class="doclogin" value="登录">登录</button>
                </div>
                <div class="clear"></div>
        </form>
    </div>
</div>
<script language="JavaScript">
    // 医院双向绑定
    var hosinput = document.getElementById("hos-name"),
        desc = document.getElementById("hos-desc");
    hosinput.oninput = function (e) {
        desc.innerHTML = this.value;
    };
    function doc_login() {
    }
    $(".doclogin").click(function () {
        $(this).attr('disabled', true);
        var that = this;
        if(!$('.user_name').val()){
            layer.msg('请输入姓名!', {icon: 2});
            $(this).attr('disabled', false);
            return false;
        }
        if(!$('.doc_hospital').val()){
            layer.msg('请输入医院!', {icon: 2});
            $(this).attr('disabled', false);
            return false;
        }
        if(!$('.mobile').val()){
            layer.msg('请输入手机号!', {icon: 2});
            $(this).attr('disabled', false);
            return false;
        }

        $.ajax({
            type: "POST",
            url: "{:url('Webmeeting/Xelodadoctor')}",
            data: $('form').serialize(),
            success: function (data) {
                console.log(data);
                if (data.code) {
                    layer.msg(data.msg, {icon: 1});
                    setTimeout(function () {
                        location.href = data.url;
                    }, 1000);
                } else {
                    layer.msg(data.msg, {icon: 2});
                }
                $(that).attr('disabled', false);
            },
            error: function (request) {
                layer.msg('页面错误', {icon: 2});
                $(that).attr('disabled', false);
            }
        });
    })
</script>
</body>
